﻿@model TaoNiuOA.Models.Task
@{
    ViewBag.Title = Model.Name;
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<script type="text/javascript">
    function showLevel(obj) {
        switch (obj) {
            case 0:
                document.write("低");
                break;
            case 1:
                document.write("普通");
                break;
            case 2:
                document.write("高");
                break;
            default:
                document.write("紧急");
        }
    }

    function showStatus(obj) {
        switch (obj) {
            case 0:
                document.write("未被领取");
                break;
            case 1:
                document.write("已被领取");
                break;
            case 2:
                document.write("执行中");
                break;
            default:
                document.write("已完成");
        }
    }
</script>
<fieldset>
    <legend>任务详细</legend>
    <br />
    <table>
        <tr>
            <td>
                名称
            </td>
            <td>
                @Html.DisplayFor(model => model.Name)
            </td>
        </tr>
        <tr>
            <td>
                类型
            </td>
            <td>
                @Html.DisplayFor(model => model.GetTaskType().TypeName)
            </td>
        </tr>
        <tr>
            <td>
                发布时间
            </td>
            <td>
                @Html.DisplayFor(model => model.PubTime)
            </td>
        </tr>
        <tr>
            <td>
                内容
            </td>
            <td>
                @Html.Raw(Model.Content)
            </td>
        </tr>
        <tr>
            <td>
                绩效
            </td>
            <td>@Html.DisplayFor(model => model.Point)
            </td>
        </tr>
        <tr>
            <td>
                任务期限
            </td>
            <td>
                @Html.DisplayFor(model => model.ProjectLast)
            </td>
        </tr>
        <tr>
            <td>
                所需天数
            </td>
            <td>
                @Html.DisplayFor(model => model.TotalDays)
            </td>
        </tr>
        <tr>
            <td>
                级别
            </td>
            <td>
                <script>
                   showLevel(@Model.Level);
                </script>
            </td>
        </tr>
        <tr>
            <td>
                进度
            </td>
            <td>@Html.DisplayFor(model => model.Process)
            </td>
        </tr>
        <tr>
            <td>
                开始时间
            </td>
            <td>
                @Html.DisplayFor(model => model.StartTime)
            </td>
        </tr>
        <tr>
            <td>
                结束时间
            </td>
            <td>
                @Html.DisplayFor(model => model.EndTime)
            </td>
        </tr>
        <tr>
            <td>
                已持续天数
            </td>
            <td>
                @Html.DisplayFor(model => model.LastDays)
            </td>
        </tr>
        <tr>
            <td>
                状态
            </td>
            <td>
                <script>   
                showStatus(@Model.Status);
                </script>
            </td>
        </tr>
        <tr>
            <td>
                最后更新
            </td>
            <td>
                @Html.DisplayFor(model => model.LastUpdate)
            </td>
        </tr>
        <tr>
            <td>
                负责人
            </td>
            <td>
                @Html.DisplayFor(model => model.GetUser().GetUserInfo().Name)
            </td>
        </tr>
        <tr>
            <td>
                是否合格
            </td>
            <td>
                @ViewBag.IsGood
            </td>
        </tr>
        <tr>
            <td>
                审批
            </td>
            <td>
                @Model.GetApprover().GetUserInfo().Name
            </td>
        </tr>
        <tr>
            <td>
                备注
            </td>
            <td>
                @Model.Remark
            </td>
        </tr>
    </table>
</fieldset>
<p>
    @Html.ActionLink("编辑", "Edit", new { id = Model.TaskID }) |
    @Html.ActionLink("返回任务列表", "Index")
</p>
